Skip to content

fix(eio): make _query optional in EngineRequest#5495

Closed
elementnl wants to merge 1 commit into
socketio:mainfrom
elementnl:fix/engine-request-optional-query
Closed

fix(eio): make _query optional in EngineRequest#5495
elementnl wants to merge 1 commit into
socketio:mainfrom
elementnl:fix/engine-request-optional-query

Conversation

@elementnl
Copy link
Copy Markdown

Fixes #5468

EngineRequest declared _query as required, but the property is set lazily by prepare() and doesn't exist on a raw IncomingMessage. This caused a TypeScript error when passing a plain IncomingMessage where an EngineRequest is expected; for example, in Nuxt integrations following the official guide.

Before: Any code that worked with EngineRequest directly would get a TypeScript mismatch error because _query was required but not present on the underlying IncomingMessage.

After: _query is typed as optional in EngineRequest and in the Transport constructor, which correctly reflects the lifecycle of the property: it may not be set at construction time, but is always guaranteed to be present by the time any transport logic runs. transports/index.ts is also updated for consistency.

No tests added - this is a TypeScript-only change with no runtime behavior difference.

@darrachequesne
Copy link
Copy Markdown
Member

Thanks for your report 👍

I think this was (indirectly) fixed by b059af6, included in engine.io@6.6.7. The public API now uses a plain IncomingMessage object.

So I think we can close this. Please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[engine.io] _query should be optional

2 participants